/**
 * 创建线程方法二：实现runnable接口，重写run方法
 */
public class TestThread02 implements Runnable{
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("run方法执行"+i);
        }
    }

    public static void main(String[] args) {
        //创建runnable接口的实现类对象
        TestThread02 testThread02 = new TestThread02();
        Thread thread = new Thread(testThread02);
        thread.start();

        for (int i = 0; i < 100; i++) {
            System.out.println("主线程执行"+i);
        }
    }
}
